﻿<UserControl x:Class="Presentation.LoginView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008">
    <UserControl.Background>
        <LinearGradientBrush>
            <GradientStop Color="#2B003B"
                          Offset="0"></GradientStop>
            <GradientStop Color="#52156A"
                          Offset="1"></GradientStop>
        </LinearGradientBrush>
    </UserControl.Background>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>


        <StackPanel Orientation="Horizontal"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Bottom">
            <TextBlock Text="Login : "
                       FontSize="17"
                       Foreground="White"
                       FontFamily="Segoe UI"
                       Margin="0,0,5,0"
                       VerticalAlignment="Center"></TextBlock>
            <ComboBox x:Name="cmbUsername"
                      SelectedItem="{Binding Path=SelectedUser}"
                      ItemsSource="{Binding Path=Users}"
                      Width="150"
                      FontSize="15">
            </ComboBox>
            <Button x:Name="btnOpenSession"
                    Content="Ouvrir une session"
                    Command="{Binding Path=OpenSessionCommand}"
                    Padding="10,0,10,0"
                    Margin="5,0,0,0"></Button>
        </StackPanel>

        <Border x:Name="waitIndicator"
                Grid.Row="1"
                Padding="3"
                VerticalAlignment="Center"
                Visibility="{Binding Path=IsOpeningSession, Converter={StaticResource BooleanToVisibilityConverter}}">
            <StackPanel HorizontalAlignment="Center">
                <TextBlock Text="Connexion en cours ..."
                           FontSize="12"
                           Foreground="White"
                           FontFamily="Segoe UI"></TextBlock>
                <ProgressBar Height="10"
                             Margin="0,3,0,0"
                             IsIndeterminate="True"></ProgressBar>
            </StackPanel>
        </Border>

    </Grid>

</UserControl>
